from PyQt4 import QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
import numpy as np 
 
class MplCanvas(FigureCanvas):
    def __init__(self, dataGrafico):
        #Definimos una figura de 6 pulgadas por 6 pulgadas, con una resolucion de 100dpi y un fondo de color lightsteelblue.
        self.fig = Figure(figsize=(5,30),dpi=75)  
        
        self.Canvas=FigureCanvas.__init__(self, self.fig)
        self.Canvas=FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding)
        self.Canvas=FigureCanvas.updateGeometry(self)
        ax=self.fig.add_subplot(111)
        
        ax.plot(dataGrafico)
        ax.set_xlabel('Tiempo')
        ax.set_ylabel('Magnitud')
        
        ax.axis([0,len(dataGrafico),min(dataGrafico),max(dataGrafico)])
        
        
        
        
        